<?xml version="1.0" encoding="utf-8" ?>
<Recipe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  Name="ContentTypeFieldRef"
  xmlns="http://schemas.microsoft.com/pag/gax-core"
  Bound="false">
  <DocumentationLinks>
    <Link Caption="Content Type Definition Schema" Url="http://msdn.microsoft.com/en-us/library/ms463449.aspx" Kind="Documentation"/>
  </DocumentationLinks>
  <xi:include href="../../../TypeAlias.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
  <Caption>ContentType: Add Field</Caption>
  <Description>Adds a field reference to the content type</Description>
  <HostData Priority="10">
    <Icon File="Help/Icons/icon_ListAndDoc.ico" />
    <CommandBar Menu="SPSFFolderArtefacts"/>
    <CommandBar Menu="SPSFItemArtefacts"/>
    <spsf:MetaData
      Visible="true"
      BindingType="XmlMergeReference"
      Enabled="true"
      CreateVSTemplate="false"
      XPath="/ns:Elements/ns:ContentType"
      XPathNamespace="http://schemas.microsoft.com/sharepoint/"
      Category="ListAndDoc"
      xmlns:spsf="http://www.spalmblogger.de">
      <spsf:Authors>
        <spsf:Author>Torsten Mandelkow</spsf:Author>
      </spsf:Authors>
      <spsf:VersionHistory>
        <spsf:VersionHistoryEntry>1.0 Initial Recipe</spsf:VersionHistoryEntry>
      </spsf:VersionHistory>
      <spsf:WebPageContent>
        <![CDATA[]]>
      </spsf:WebPageContent>
    </spsf:MetaData>
  </HostData>
  <Arguments>

    <!-- set standard parameters -->
    <Argument Name="AllowedScopes" Type="System.String">
      <ValueProvider Type="Evaluator" Expression="Site" />
    </Argument>

    <Argument Name="ParentElementManifestElement" Type="NameValueItem" Required="true" >
      <Converter Type="AvailableContentTypesConverter" />
    </Argument>

    <xi:include href="../../BaseArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />
    <xi:include href="../BaseElementsManifestArguments.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Arguments/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <Argument Name="ContentTypeFieldRefs" Required="false" Type="NameValueItemArray" >
      <ValueProvider Type="DefaultNameValueCollectionProvider"  />
    </Argument>
    <Argument Name="ContentTypeRemoveFieldRefs" Required="false" Type="NameValueItemArray" >
      <ValueProvider Type="DefaultNameValueCollectionProvider"  />
    </Argument>

  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Height="350">
          <Title>Parent Element</Title>
          <Fields>
            <Field Label="Branding" ValueName="SPSFBranding" PanelType="SPALM.SharePointSoftwareFactory.Library.BrandingPanel, SPALM.SharePointSoftwareFactory.Library" />
            <Field PanelType="SPALM.SharePointSoftwareFactory.Library.NameValueListViewPanel, SPALM.SharePointSoftwareFactory.Library" ValueName="ParentElementManifestElement" Label="Parent Content Type" >
              <Help>Required. Select the content type.</Help>
              <Editor Type="SPALM.SharePointSoftwareFactory.Library.ContentTypeEditorInternal, SPALM.SharePointSoftwareFactory.Library" />
            </Field>
          </Fields>
        </Page>
        <Page Height="350">
          <Title>Fields</Title>
          <Fields>
            <Field PanelType="SPALM.SharePointSoftwareFactory.Library.NameValueListPanel, SPALM.SharePointSoftwareFactory.Library" ValueName="ContentTypeFieldRefs" Label="Fields" >
              <Help>Optional. Specifies a column to reference in this content type.</Help>
              <Editor Type="SPALM.SharePointSoftwareFactory.Library.SiteColumnEditor, SPALM.SharePointSoftwareFactory.Library" />
            </Field>
            <Field ValueName="ContentTypeRemoveFieldRefs" PanelType="SPALM.SharePointSoftwareFactory.Library.NameValueListPanel, SPALM.SharePointSoftwareFactory.Library" Label="Remove Fields" >
              <Help>Optional. Specifies a column reference, included in the parent content type, to be removed from this content type.</Help>
              <Editor Type="SPALM.SharePointSoftwareFactory.Library.SiteColumnEditor, SPALM.SharePointSoftwareFactory.Library" />
            </Field>
          </Fields>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="ConditionalCoordinator">

    <xi:include href="../../BaseStartingActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

    <!-- Add XML for document template -->
    <Action
      Name="AddXmlContent"
      Type="AddXmlToItemAction"
      XPath="/ns:Elements/ns:ContentType[@ID='$(ParentElementManifestElement)']"
      XPathNamespace="http://schemas.microsoft.com/sharepoint/"
      ReplaceExistingNode="false"
      Open="true"
      TemplateFileName="Text\ContentType\elements_FieldRef.xml.t4">
      <Input Name="SelectedItem" RecipeArgument="VisualStudioSelectedItem" />
    </Action>

    <xi:include href="../../BaseFinalActions.include" parse="xml" xpointer="xmlns(p=http://schemas.microsoft.com/pag/gax-core) xpointer(/p:Actions/*)" xmlns:xi="http://www.w3.org/2001/XInclude" />

  </Actions>
</Recipe>